
using UnityEngine;
using UnityEngine.SceneManagement;

/**
 * 初始选择界面
 */
public class Option : MonoBehaviour
{

    private int choice = 1;

    public Transform postOne;
    public Transform postTwo;
    // Start is called before the first frame update
    void Start()
    {

    }

    // Update is called once per frame
    void Update()
    {
        if (Input.GetKeyDown(KeyCode.W))
        {
            choice = 1;
            transform.position = postOne.position;
        }
        else if (Input.GetKeyDown(KeyCode.S))
        {
            choice = 2;
            transform.position = postTwo.position;
        }

        if (choice == 1 && Input.GetKeyDown(KeyCode.Space))
        {
            //加载第一个场景
            SceneManager.LoadScene(1);
        }
    }
}
